Skip to content

Conversation

jamillambert
Copy link
Collaborator

@jamillambert jamillambert commented Aug 26, 2025

sendmany is implemented for v17 but untested and it has a new verbose return type in v18.

The client macro sends the amount in sats but the RPC takes BTC.

  • Add the verbose struct to v18 and model.
  • Update the client macro.
  • Add a verbose client macro, test and update the types table.

let model: Result<mtype::SendMany, _> = json.into_model();
let txid = model.unwrap().0;

assert_eq!(txid.to_string().len(), 64);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this line aiming to test mate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to check that txid holds a txid, but I don't know in advance what it is so I just check it is the correct length.
There were other tests that I thought were working because the field I tested in the returned RPC was not empty, but then looking further the field was populated by an error message.

Do you have a better suggestion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we've called into_model the txid should have been parsed from the string so an error message or any other junk will be caught there - I would expect it to be anyways, otherwise something is very wrong.

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from the txid thing.

@tcharding
Copy link
Member

Reviewed 5e09bbd

`sendmany` has a new verbose return type in v18.

The client macro sends the amount of sats but the RPC takes BTC.

Add the verbose struct to v18 and model.

Update the client macro.

Add a verbose client macro, test and update the types table.
@jamillambert jamillambert marked this pull request as ready for review September 2, 2025 08:05
@jamillambert
Copy link
Collaborator Author

Removed the redundant txid check and rebased on master.

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 175bafd

@tcharding tcharding merged commit 22b1a75 into rust-bitcoin:master Sep 3, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants